package com.ckzp.jfinal.base;

import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.TableMapping;

import java.util.List;

/**
 * Created by 51594 on 2024/3/13.
 */
public class BaseUtil {


    /**
     * 根据列取数据
     *
     * @param column
     * @param value
     * @return
     */
    public List findByField(Model model, String column, Object value) {
        String table_name = TableMapping.me().getTable(model.getClass()).getName();
        return model.dao().find("select * from " + table_name + " where " + column + " =?", value);
    }
}
